﻿using DtoFw;
using DtoFw.Query;
using DtoFw.Result;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Service;
using System.Collections.Generic;


namespace SceneEvidenceAPI.Controllers
{
    [Route("api")]
    [AllowAnonymous]
    public class HaiKangController
    {
        private readonly PartyService _partyService;
        /// <summary>
        /// 
        /// </summary>
        /// <param name="partyService"></param>
        public HaiKangController(PartyService partyService)
        {
            this._partyService = partyService;
        }

        /// <summary>
        /// 海康获取要开门的数据
        /// </summary>
        /// <returns></returns>
        [HttpGet("queryTransEvidences")]
        public HaiKangTransDto QueryTransEvidences(string tranNo)
        {
            return _partyService.QueryTransEvidences(tranNo);
        }

        /// <summary>
        /// corpCode	单位编号	Y	String	
        ///deviceCode	设备编号	Y	String	
        ///startTime	开始时间	N	String	更新时间
        ///endTime	结束时间	N	String	更新时间
        ///orderby	排序	N	String	
        ///pageNum	当前页	Y	Number	
        ///pageSize	每页返回条数	Y	Number	最大200，默认20
        ////api/v1/cabinet/boxUserList?
        /// </summary>
        [AllowAnonymous]
        [HttpGet("v1/cabinet/boxUserList")]
        public HaiKangBoxUserList GetBoxUserList(string corpCode, string deviceCode, string startTime, string endTime, string orderby, int pageNum, int pageSize)
        {
            return _partyService.GetBoxUserList(corpCode, deviceCode, startTime, endTime, orderby, pageNum, pageSize);
        }
    }
}
